// pages/referralService/list/list.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    activeIndex: 1,
    orderStatus: [
      {
        label: "未开始",
        value: "未开始"
      },
      {
        label: "已完成",
        value: "已完成"
      },
      {
        label: "已逾期",
        value: "已逾期"
      },
      {
        label: "已拒绝",
        value: "已拒绝"
      },
      {
        label: "转诊中",
        value: "转诊中"
      },
    ]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  change (e) {
    this.setData({
      activeIndex: e.currentTarget.dataset.index
    })
  },
  /**
   * 用户点击跳转订单详情
   */
  toDetail (e) {
    const status = e.currentTarget.dataset.status
    const detailMap = {
      '已拒绝': '/pages/referralService/detail/rejected/rejected',
      '转诊中': '/pages/referralService/detail/going/going',
      '未开始': '/pages/referralService/detail/waiting/waiting',
      '已逾期': '/pages/referralService/detail/overdue/overdue',
      '已完成': '/pages/referralService/detail/completed/completed',
      '待处理': '/pages/referralService/detail/pending/pending',
    }
    wx.navigateTo({
      url: detailMap[status],
    })
  }
})